#!/usr/bin/env node
import wts = require('@swc/wasm-typescript');
import transform = wts.transform;
const tsSourceCode = /* TS */ `
export function add(a: number, b: number) {
    return a + b;
}
`;
type Soon = unknown;
type Possible = any;

const _: Possible = 1 as Soon as Possible;
type Arr<T> = T extends number ? readonly T[] : T[];
type _a = Arr<number | string>;
//    ^?
(async () => {
  const { code } = await transform(tsSourceCode, {
    mode: 'strip-only',
    // transform: {
    //   tsEnumIsMutable: true,
    // },
    // TransformConfig: null
  });
  console.log(code);
})();

// ! FAIL
// type Wrapped<T> = { value: T };
// type Comparable = number | Wrapped<Comparable>;

let xy: { x: 1 } & { y: 2 } = { x: 1, y: 2 };
